package chapter02;

import java.util.Scanner;

public class Access {
    public static void main(String[] args) {
        // 华为
        double huaweiPrice = 3688.88;
        int huaweikucun = 0;
        double totalPrice = 0;
        double xiaomiPrice = 2988.88;
        int xiaomikucun = 0;
        double xiaomitota = 0;

        System.out.println("品牌型号:华为");
        System.out.println("尺寸:5.5");
        System.out.println("价格:" + huaweiPrice);
        System.out.println("配置:8+128G 全面刘海屏");
        System.out.println("请输入华为手机库存数量");
        /** 引入Scanner类
         *
         */
        Scanner scl = new Scanner(System.in);
        huaweikucun = scl.nextInt();
        totalPrice = huaweiPrice * huaweikucun;
        System.out.println("库存华为手机的总金额:" + totalPrice);

        System.out.println("品牌型号:小米");
        System.out.println("尺寸:5.0");
        System.out.println("价格:" + xiaomiPrice);
        System.out.println("配置:4+64G 全面屏");
        System.out.println("请输入小米手机库存数量");

        xiaomikucun = scl.nextInt();
        xiaomitota = xiaomiPrice * xiaomikucun;
        System.out.println("库存小米手机的总金额:" + xiaomitota);


        System.out.println("------------库存清单------------");
        System.out.println("品牌型号   尺寸   价格          配置       库存数量   总价");
        System.out.println("华为      5.5  " + huaweiPrice + "  8+128G  全面刘海屏  " + huaweikucun + "  "  + totalPrice);
        System.out.println("小米      5.0  " + xiaomiPrice + "  4+64G     全面屏   " + xiaomikucun + "  " + xiaomitota);

        System.out.println("-------------------------------");
        System.out.println("总库存: "+(huaweikucun+xiaomikucun));
        System.out.println("库存总价: "+(totalPrice+xiaomitota)+"￥");
    }
}
